var express = require('express');
var router = express.Router();
var db = require("../db");

/* GET users listing. */
router.post('/', function (req, res, next) {
    var params = req.body;
    var sql = "INSERT INTO EC_ORDER(type,name,phone,address,msg,created_time) VALUES(?,?,?,?,?,NOW())";
    var vals = [params.type, params.name, params.phone, params.address, params.msg];
    db.pool.query(sql, vals, function (err) {
        if (err) {
            console.log(err);
        }
        res.send("success");
    });
});

module.exports = router;
